#pragma once
#include "projHeader.h"

movingObj::movingObj (int length)
{
	if (length < 1) length = 1;
	this->length = length;
	X = new int [length];
	Y = new int [length];
	sym = new char [length];
	color = new int [length];
	cache = new char [length];
	cacheColor = new int [length];
	turn = rand () % 40;
	turn %= 4;
	direction = rand () % 40;
	direction %= 4;
	cacheAuthor = new char* [length];
	cacheDescr = new char* [length];
	for (int i = 0; i < length; i++)
	{
		sym [i] = (char) 1;
		color [i] = 1;
		X[i] = 1 + i;
		Y[i] = 1;
		cacheAuthor [i] = new char [5];
		strcpy (cacheAuthor[i], "none");
		cacheDescr [i] = new char [5];
		strcpy (cacheDescr[i], "none");
	}
}

void movingObj::show ()
{
}

void movingObj::move ()
{
}

movingObj::~movingObj(void)
{
	delete [] sym;
	delete [] color;
	delete [] cache;
	delete [] cacheColor;
	delete [] X;
	delete [] Y;
	for (int i = 0; i < length; i++)
	{
		delete [] cacheAuthor [i];
		delete [] cacheDescr [i];
	}
	delete [] cacheAuthor;
	delete [] cacheDescr;
}
